/**
 * Created by LJY on 2017/3/12.
 */
import java.util.Scanner;
class CashCard2 {
    String number;
    int balance;
    int bonus;
    CashCard2(String number, int balance, int bonus){
        this.number=number;
        this.balance=balance;
        this.bonus=bonus;
    }
    void store(int money){
        if(money>0){
            this.balance+=money;
            if(money>=1000){
                this.bonus++;
            }
        }
        else{
            System.out.println("储值为负");
        }
    }
    void charge(int money){
        if(money>0){
            if(money<=this.balance){
                this.balance-=money;
            }
            else {
                System.out.println("钱不够");
            }
        }
        else{
            System.out.println("扣负数？");
        }
    }
    int exchange(int bonus){
        if(bonus>0){
            this.bonus-=bonus;
        }
        return this.bonus;
    }


}
